import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams} from 'ionic-angular';
import {ValidateProvider} from "../../providers/validate/validate";

@IonicPage()
@Component({
    selector: 'page-commend',
    templateUrl: 'commend.html',
})
export class CommendPage {
    task_status: boolean = true;
    interested_status: boolean = true;
    push_status: boolean = true;

    constructor(
        public navCtrl: NavController,
        public navParams: NavParams,
        public validate: ValidateProvider
    ) {
    }

    ionViewCanEnter(){
        return this.validate.checkLogin();
    }

    fold(type, status) {
        switch (type) {
            case 'task' :
                this.task_status = !status;
                break;
            case 'interested' :
                this.interested_status = !status;
                break;
            case 'push' :
                this.push_status = !status;
                break;
            default:
                this.task_status = true;
                this.interested_status = true;
                this.push_status = true;
        }
    }

}
